<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</meta>
<title>F.diff</title>
<link type="text/css" rel="stylesheet" href="../css/admin.css" />
<link type="text/css" rel="stylesheet" href="../css/item_show.css" />
<script type="text/javascript" src="../../1st.js"></script>
<script type="text/javascript" src="../../1st.highlight.js"></script>
</head>
<body id="split">
<div id="content">
	<div rel="F.param">
		<h2><span>返回值:</span>F.diff</h2>
					<h3>概述 : 返回两个时间的差值，返回一个数组，分别代表天，小时， 分，秒，毫秒差</h3>
						
			<div class="desc">
				<div class="longdesc"><pre>原型写法：dateObj.diff(d2)</pre></div>
			</div>
							<h3>语法1：F.diff(d1, d2)</h3>
						<table class="args">
				<!--caption>参数列表：(2)</caption-->
				<tr><th>参数名称</th><th>类型</th><th>描述</th></tr>
									<tr><td><strong>d1</strong></td><td>Date,String</td><td>日期1</td></tr>
									<tr><td><strong>d2</strong></td><td>Date,String</td><td>日期2</td></tr>
								<tr><td colspan="3">&nbsp;</td></tr>
				<tr><td>返回值</td><td>Array</td><td>返回时间差数组</td></tr>
			</table>
				<div class="example">
			<h3>示例 : </h3>
							<h5 xmlns="">CSS代码:</h5>
				<pre xmlns=""><code id="cssbox"></code></pre>
						
							<h5 xmlns="">HTML代码:</h5>
				<pre xmlns=""><code id="htmlbox"></code></pre>
									
				<h5 xmlns="">JS代码:</h5>
				<pre xmlns=""><code id="jsbox"></code></pre>
										
				<h5 xmlns="">结果:</h5>
				<pre xmlns=""><code id="resultbox"></code><code></code></pre>
					</div>
		<div style="text-align:right">
			
					
				<button onclick="window.open('../codepages/85.html');">运行代码</button>
						
		</div><br/>	
		<div>
			<h3>同类参考 :</h3>
			<div>
							<span><a href='107.html'>F.format</a></span>						</div>
		</div>
	</div>
</div><br />

<textarea id="css" style="display:none;">#box b{background-color:#9c0000; margin:0 5px; color:#fff; display:inline-table; width:35px; text-align:center;}</textarea>
<textarea id="html" style="display:none;"><div>离深圳大运会开幕时间还有：<span id="box"></span></div></textarea>
<textarea id="js" style="display:none;">F.ajax(F.data("data.php?act=getdate")).callback(function(d){
	var d2 = new Date(F.date("2011-8-12 20:00").getTime()-new Date().diff(d,1));
	var fun = function(){
		var arr = new Date().diff(d2);
		arr[4] = arr[4].zero(3);
		F("box").html("<b>$0</b>天<b>$1</b>小时<b>$2</b>分<b>$3</b>秒<b>$4</b>毫秒".mix(arr)); 
	};
	fun();
	window.setInterval(fun, 99);
});</textarea>
<textarea id="result" style="display:none;">[3893,19,35,22,141]</textarea>


<script type="text/javascript">
var css = F('css').val();
var html = F('html').val();		
var js = F('js').val();
var result = F('result').val();
css && F('cssbox').highlight(css, "css");
html && F('htmlbox').highlight(html, "html");
js && F('jsbox').highlight(js, "js");
result && F('resultbox').highlight(result,"js");
</script>

</body>
</html>